import request from "@/utils/request";


//查询图书数据
export const queryApiBook = (username,name,borrow_time,page,pageSize) =>{
  // 构建查询参数对象
  const params = {
    username: username || undefined,
    name: name || undefined,
    borrow_time: borrow_time || undefined,
    page: page,
    pageSize: pageSize
  };

// 使用axios的params参数，让axios自动处理参数构建和编码
  return request.get('/books/return/page', { params });
} 

//归还图书
export const returnBookApi = (books) => request.put('/books/returnBook',books)

